Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeshWithRenderer を MeshExportInfo に統合 #1005

Merged
merged 7 commits into from
Jun 3, 2021

Conversation

ousttrue
Copy link
Contributor

@ousttrue ousttrue commented Jun 3, 2021

#965

  • Mesh + Materials をキーにしてユニークさを確保する
  • Mesh + Materials に対して、一つ以上の SkinnedMeshRenderer もしくは MeshRenderer が関連する
  • 複数の SkinnedMeshRenderer があってかつ SkinnedMeshRenderer.bones の重複が発生する場合に、 異なる index 置き換え (JointIndexMap) が発生する場合はサポートしない

@ousttrue ousttrue requested a review from Santarh June 3, 2021 11:26
@ousttrue ousttrue added this to the v0.76 milestone Jun 3, 2021
/// <summary>
/// ひとつの Mesh を複数の Renderer が共有することがありうる
/// </summary>
List<(Renderer, Transform[] UniqueBones)> _renderers;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mesh + Material[] に対して 複数の Renderer。ついでに、Skinning 情報。
同じスキニングに対して、違う SkinnedMeshRenderer.bones を想定。

Copy link
Contributor

@Santarh Santarh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よさそう

using UnityEngine;

namespace UniGLTF
{
[Serializable]
public struct MeshExportInfo
public class MeshExportInfo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MeshExportInfo Export する Mesh を確定させる Unique なオブジェクト

{
if (Materials[i] != materials[i]) return false;
}
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mesh とすべての Material のインスタンスが同じなら同じ Mesh として Export する

@ousttrue ousttrue merged commit d46819b into vrm-c:master Jun 3, 2021
@ousttrue ousttrue deleted the fix/mesh_export_info branch October 27, 2021 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants